<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title><%= @page_title %></title>
  <%= javascript_include_tag :defaults %>
  <style>
    *{margin:0; padding:0;}
    img{border:0;}
    body{font-size:12px; font-family:"宋体", Arial; background:url(/images/user/test/bodybg_1.gif) repeat-x;}
    #mainbody{width:820px; margin:0 auto; margin-top:20px; background:url(/images/user/test/bg.gif) no-repeat;background-color:#98be53; border-top:2px #FFFFFF solid;border-left:2px #FFFFFF solid;border-right:2px #FFFFFF solid;}
    #head{width:820px; height:88px;}
    #logo{width:220px; height:78px;float:left; margin-top:10px; margin-left:5px;}
    #head_text{width:200px; float:left; height:20px; line-height:20px; margin-top:48px; color:#fff;}
    #mainlist{width:800px; margin:0 auto; margin-top:8px; background-color:#FFFFFF;}
    .onelist{width:720px; height:180px; margin:10px auto; border-bottom:2px solid #ccc; padding-bottom:10px; padding-left:10px; padding-top:15px;line-height:1.5; }
    .list_left{width:560px; float:left;border-right:1px dashed #000000; padding-right:10px;}
    .list_left h2{font-size:14px; color:#0066FF; margin-bottom:10px;}
    .list_left img{border:1px solid #ccc; padding:5px; float:left; margin-right:20px; margin-bottom:10px;}
    .list_right{width:140px; height:160px; float:right; margin-top:15px; text-align:center; color:#999999;}
    .list_right a{color:#0066CC;}
    .button-to input{background:url(/images/user/test/button.jpg) no-repeat; width:100px; height:30px; border:0; margin-top:20px; margin-bottom:20px; color:#FFFFFF;}

    #foot{width:820px; height:64px; margin:-15px auto; background-color: #98BE53;}
  </style>
</head>

<body>
<div id="mainbody">
	<div id="head">
		<div id="logo">
			<img src="/images/user/test/logo_1.gif" width="220" height="78" />
		</div>
			<div id="head_text">
				测试量表 beta
			</div>
	</div>
		<div id="mainlist">
                        <% @tests.each do |test| %>
			<div class="onelist">
			  <div class="list_left">
                            <%= image_tag("uploads/fullsize/#{test.images[0].filename if test.images.size > 0}",
                               :height => '150', :width => '150')%>
                            <h2><%=h test.name %></h2>
                            <p>
                              <%=h(truncate(test.description,  :length => 320)) %>
                            </p>
                          </div>
                          <div class="list_right">
                          8176人参与<br />
                          <!--此处判断用户是否已经做过该测试，如果已经完成显示 重新测试，如果没有则正常显示-->
                          
                          <% if current_user.tested?(test) %>
                            已测
                            <%= button_to '重新测试', {:id => test, :action => "complete_info" }%><br />
                            <a href="/user/test/get_result/<%=test.id%>">查看报告>></a>
                          <% else %>
                            <%= button_to '开始测试', {:id => test, :action => "complete_info" }%><br />
                          <% end %>
                         <br/>
                          <a href="#">查看好友测试报告>></a>
                          </div>
			</div>

                        <% end %>
		</div>
</div>
<div id="foot">
</div>

</body>
</html>

